package com.qaml.mes.device.utils;

import cn.hutool.core.lang.Snowflake;
import cn.hutool.core.util.IdUtil;
import org.springframework.stereotype.Component;

import java.util.HashSet;
import java.util.Random;
import java.util.Set;

/**
 * @ClassName IdGenerateUtils
 * @Description id生成工具
 * @Author leikai
 * @Date 2023/10/25 13:20
 * @Version 1.0
 */
@Component
public class IdGenerateUtils {

    private static final Snowflake snowFlake = IdUtil.getSnowflake(2, 1);

    public static Long getId() {
        return snowFlake.nextId();
    }

    public static String getIdStr() {
        return snowFlake.nextIdStr();
    }


}